package project.parser.ast.values;

import project.parser.ast.types.PrimType;
import project.parser.ast.types.Type;

final public class BoolValue extends AbstractValue<Boolean> {

	public BoolValue(Boolean value) {
		super(value);
	}

	@Override
	public Type type() {
		return PrimType.BOOLEAN_TYPE;
	}

	@Override
	public Boolean asBoolean() {
		return value;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!(obj instanceof BoolValue))
			return false;
		return value.equals(((BoolValue)obj).value);
	}

}
